-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typescript(vx-shape): Re-write package in TypeScript #507
Conversation
4ece259
to
d91090e
Compare
value: number | NumAccessor, | ||
) { | ||
if (typeof value === 'number') func(value); | ||
else func(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷♂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is so weird. asked mohsen about it and he wasn't sure 🤔
packages/vx-shape/src/shapes/link/curve/LinkHorizontalCurve.tsx
Outdated
Show resolved
Hide resolved
…res to omit own props
016edcd
to
d5cee59
Compare
whew. lots of test errors that didn't always show up locally 🤔 |
data, | ||
path, | ||
x = (d: $TSFIXME) => d.y, // note this returns a y value | ||
y = (d: $TSFIXME) => d.x, // note this returns a y value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a blocker but the second commend should be x value
🚀 Enhancements
This PR builds off #488 which introduces
Typescript
build config, and re-writes the@vx/shape
package inTypeScript
. Unfortunately this package is one of the biggest ones, so this PR is pretty sizable and larger than the other re-writes.A couple of notes:
@types/d3-path
and@types/d3-shape
dependencies so that we can leverage/propagate existing types in our d3 usage.@vx/point
dependency .Type
s.💥 Breaking Changes
React.Fragment
s, which requires bumping thepeerDep
forreact
to^16.3.0-0
@vx/shape
theArc
centroid
prop was removed as it was not functional (it was called as if it was anarc.centroid()
configuration parameter, but in reality the.centroid
method is for returning the centroid of a datum.@vx/shape
theArea
component is no longer wrapped in an empty<g>
elementpropTypes
across all components are likely stricter.children(...)
render function overrides are wrapped inReact.Fragment
s<>{children(...)</>
to satisfy Types.order
andoffset
props forStack
,BarStack
,BarStackHorizontal
, andAreaStack
previously supported strings, arrays, or functions. Only thestring
prop was functional, and only the enumeratedstring
presets are now allowed.Closes #506
Testing
/gallery
.d.ts
files@hshoff @schillerk @milesj @techniq @kristw